package com.sugar.queryinfo.module.business.dal.mysql.dataqueryqjld;

import com.sugar.queryinfo.framework.common.pojo.PageResult;
import com.sugar.queryinfo.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.queryinfo.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.queryinfo.module.business.controller.admin.data.dataqueryqjld.vo.DataQueryQjldPageReqVO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryqjld.DataQueryQjldDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 数据查询-全景雷达 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface DataQueryQjldMapper extends BaseMapperX<DataQueryQjldDO> {

    default PageResult<DataQueryQjldDO> selectPage(DataQueryQjldPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DataQueryQjldDO>()
                .eqIfPresent(DataQueryQjldDO::getUserId, reqVO.getUserId())
                .eqIfPresent(DataQueryQjldDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(DataQueryQjldDO::getDataId, reqVO.getDataId())
                .betweenIfPresent(DataQueryQjldDO::getQueryTime, reqVO.getQueryTime())
                .betweenIfPresent(DataQueryQjldDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DataQueryQjldDO::getId));
    }

}